﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace my_proxy.RequestHandlers
{
    public class overLoadUsers
    {

        private int m_countPacket; //x
        private List<DateTime> m_time; //y
     


        public overLoadUsers()
        {
            m_countPacket = 1;
            m_time = new List<DateTime>();
            m_time.Add(DateTime.Now);
           
        }

        /********geter function ****/
        public int getCountPacket()
        {
            return m_countPacket;
        }
        public DateTime getFirstTime()
        {
            if (m_time.Count > 0)
                return m_time.ElementAt(0);
            else
                return DateTime.Now;
        }

        //set number of packet
        public void addPacket()
        {
            m_countPacket++;
            m_time.Add(DateTime.Now);
        }

        public void removePacket()
        {
            m_time.RemoveAt(0);
            m_countPacket--;
        }

    }
}
